package com.cysyz.web.modules.base.permission.tag;

import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.SimpleTagSupport;
import java.io.IOException;

/**
 * Created by cuiyong on 15/1/24.
 */
public class PermissionElseTag extends SimpleTagSupport{
    private String module;
    private String moduleFunction;
    private boolean checkPass;

    public PermissionElseTag() {
    }

    @Override
    public void doTag() throws JspException, IOException {
        PermissionChooseTag parent = (PermissionChooseTag) this.getParent();
        if (!parent.isCheckPass()) {
            getJspBody().invoke(null);
        }
    }





    public String getModule() {
        return module;
    }

    public void setModule(String module) {
        this.module = module;
    }

    public String getModuleFunction() {
        return moduleFunction;
    }

    public void setModuleFunction(String moduleFunction) {
        this.moduleFunction = moduleFunction;
    }

    public boolean isCheckPass() {
        return checkPass;
    }

    public void setCheckPass(boolean checkPass) {
        this.checkPass = checkPass;
    }
}
